using System;
using System.Threading;

namespace DosTail {
    /// <summary>
    /// Summary description for Class1.
    /// </summary>
    class ConsoleTail {
        public Tail myTail;

        public ConsoleTail ( string filename ) {
            myTail = new Tail (filename);
            myTail.MoreData += new DosTail.Tail.MoreDataHandler (myTail_MoreData);
        }

        public ConsoleTail ( string filename, int maxBytes )
            : this (filename) {
            myTail.MaxBytes = maxBytes;
        }

        public void myTail_MoreData ( object sender, string newData ) {
            Console.Write (newData);
        }

        public void Start () {
            myTail.Start ();
        }

        public void Stop () {
            myTail.Stop ();
        }

        [STAThread]
        static void Main ( string[] args ) {
            ConsoleTail tail = new ConsoleTail (args[0]);
            tail.Start ();
            while (true) ;
        }
    }
}
